require(['../config'],()=>{
    require(['swiper','jquery'],(Swiper)=>{
        new Swiper ('.swiper-container', {
            loop: true, // 循环模式选项
            autoplay:true,
            // 如果需要分页器
            pagination: {
              el: '.swiper-pagination',
            },
            
            // 如果需要前进后退按钮
            navigation: {
              nextEl: '.swiper-button-next',
              prevEl: '.swiper-button-prev',
            },
            
            // 如果需要滚动条
            scrollbar: {
              el: '.swiper-scrollbar',
            },


          })


          class Index{
            constructor(){
                this.addInput()
                this.cookie()
            }

            addInput(){
                $('input').on('click',function(){
                    $(this).siblings('span').animate({
                        top:'4px',
                        fontSize : '12px',
                        duration : 1000,
                        easing : 'linner'
                    })
                })
            }

            cookie(){

                $('.btn').on('click',function(){
                    let user = {}
                    user.name = $('#name').val()
                    user.phone = $('#phone').val()
                    user.password = $('#password').val()

                   
                    
                    if($('input').val()){
                      localStorage.setItem('user',JSON.stringify([user]))
                      alert('注册成功！')
                      window.location.href = '/index.html'

                    }else{
                      alert('请完善信息')
                    }

                    
                    

                    
                })
            }
            
          }

          new Index()
    })
})